package zy2;

/**
 * 梯形
 */
public class Trapezoid extends Graph{
    private int sd;
    private int xd;
    private int gao;
    private int yao;

    public Trapezoid(int sd, int xd, int gao, int yao) {
        this.sd = sd;
        this.xd = xd;
        this.gao = gao;
        this.yao = yao;
    }

    public Trapezoid() {
    }

    @Override
    public void perimeter() {
        double zc = sd+xd+yao*2;
        System.out.println("梯形的周长:"+zc);
    }

    @Override
    public void area() {
        double mj = (sd+xd)*gao/2;
        System.out.println("梯形的面积:"+mj);
    }
}
